package com.ai.wxy.spring.jpa.user.entity;

import com.ai.spring.data.jpa.domain.JpaEntity;
import lombok.Data;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;

/**
 * 用户
 *
 * @author 石头
 * @Date 2019/11/19
 * @Version 1.0
 **/
@Data
@Entity
@Table(name="jpa_user")
public class User extends JpaEntity {
    /**主键*/
    @Id
    private Long id;
    /**登录账号*/
    @Column(unique = true)
    private String username;
    /**真实姓名*/
    private String realname;
    /**密码*/
    private String password;
    /**密码盐*/
    private String salt;
    /**性别(0-默认未知,1-男,2-女)*/
    private Integer sex;
    /**电子邮件*/
    private String email;
    /**电话*/
    private String phone;
    /**状态(0-无效,1-正常,2-冻结)*/
    private Integer status;
    /**创建时间*/
    @Column(name = "create_time",insertable = false,updatable = false)
    private Date createTime;
    /**更新时间*/
    @Column(name = "update_time",updatable = false,insertable = false)
    private Date updateTime;

}
